//
//  SPOverlayRenderer.h
//  SPMapKit
//
//  Created by zhangbo on 2017/9/8.
//  Copyright © 2017年 zhangbo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "SPAnnotation.h"
#import <MapKit/MapKit.h>
#import "SPPolyline.h"

@protocol SPOverlayRendererDelegate <NSObject>

-(CGPoint) GPSToScreenPosition:(CLLocationCoordinate2D) gpspoint;
-(CGFloat) GroundResolution:(CGFloat) lat;

@end

@interface SPOverlayRenderer : NSObject
{
    NSMutableArray *_overlayScreenPointList;
}

-(instancetype) initWithOverlay:(id<SPOverlay>) overlay;

@property(nonatomic, weak) id<SPOverlay> overlay;
@property (nonatomic, strong) UIColor *fillColor;
@property (nonatomic, strong) UIColor *strokeColor;
@property CGFloat lineWidth;
@property CGLineJoin lineJoin;
@property CGLineCap lineCap;

@property(nonatomic, weak) id<SPOverlayRendererDelegate> delegate;

-(void) drawRect:(CGRect)rect context:(CGContextRef)context;
-(NSArray*) overlayScreenPointList;

@end

/**
 折线渲染器
 */
@interface SPPolyLineRender : SPOverlayRenderer

@end

/**
 直线渲染器
 */
@interface SPSingleLineRender : SPOverlayRenderer

@end

/**
 多边形渲染器
 */
@interface SPPolygonRender : SPPolyLineRender

@end

/**
 圆形渲染器
 */
@interface SPCircleRender : SPOverlayRenderer

@end
